package com.kfm.servlet;

import com.kfm.util.Contains;
import com.kfm.util.LoginUtil;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/index")
public class IndexServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        if (LoginUtil.isNonLogin(req.getSession())){
            resp.sendRedirect("login");
            return;
        }

        req.getRequestDispatcher("WEB-INF/index.jsp").forward(req, resp);
    }
}
